import 'package:flutter/material.dart';

class PartsWdiget extends StatefulWidget {
  final String image;
  final String text;
  final bool active;
  final Map item;

  const PartsWdiget({Key key, this.image, this.text, this.active, this.item})
      : super(key: key);

  @override
  State<PartsWdiget> createState() => _PartsWdigetState();
}

class _PartsWdigetState extends State<PartsWdiget> {
  @override
  Widget build(BuildContext context) {
    return Container(
      child: Wrap(
        children: [
          Container(
            margin: EdgeInsets.only(left: 10),
            child: Column(
              children: [
                Container(
                  width: 65,
                  height: 65,
                  color: widget.item['active']
                      ? Color.fromRGBO(217, 217, 217, 1)
                      : Color.fromRGBO(242, 242, 242, 1),
                  child: Center(
                    child: Image.asset(
                      widget.image ?? '',
                      width: 40,
                      height: 20,
                    ),
                  ),
                ),
                Container(
                  margin: EdgeInsets.only(top: 15),
                  child: Text(
                    widget.text ?? '',
                    style: TextStyle(
                      color: widget.active ?? false
                          ? Colors.black
                          : Color.fromRGBO(217, 217, 217, 1),
                    ),
                  ),
                ),
              ],
            ),
          ),
        ],
      ),
    );
  }
}
